package com.example.fw;

import org.openqa.selenium.By;

public class NavigationHelper extends HelperBase
{
	public NavigationHelper(ApplicationManager manager) {
		super(manager);
	}

	public void groupsPage() {
		//click(By.linkText("add new"));
		if (! onGroupsPage())
			click(By.linkText("groups"));
	  }

	private boolean onGroupsPage() {
		return getCurrentUrl().contains("/group.php") && isElementPresented(By.name("new"));
	}

	public void mainPage() {
		if (! onMainPage())
			click(By.linkText("home"));
	  }

	private boolean onMainPage() {
		return isElementPresented(By.id("maintable"));
	}
}
